package com.example.backend.repository;

import com.example.backend.entity.Business;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;

import java.util.List;
import java.util.Optional;

public interface BusinessRepository extends JpaRepository<Business,Integer>, CrudRepository<Business,Integer> {
    Optional<Business> findById(Integer id); //Optional类，如果值存在则 isPresent()方法会返回 true
    List<Business> findByCid(Integer cid);
    List<Business> findByVid(Integer vid);
    List<Business> findByDid(Integer did);
    List<Business> findByMode(String mode);
    List<Business> findByStartDate(String startDate);
    List<Business> findByFinishDate(String finishDate);
}
